package cn.tudu.boot32.mapper;

import cn.tudu.boot32.entity.User;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

@Mapper
public interface UserMapper {
  //如果返回值是一个对象而非是一个list集合,要求查询回来的结果必须是0条或1个
  //如果出现了大于1条情况会报错
  @Select("select * from user where username=#{username}")
  User selectByUsername(String username);
  @Insert("insert into user values(null,#{username},#{password},#{nick})")
  void insert(User user);
}
